package book;

public class BookList {

    private Book[] bookList = new Book[10];

    private int usedSize; //计数器  来记录  当前实际放的书的数量

    public BookList() {
        //构造方法  来初始化成员
        this.bookList[0] = new Book("三国演义","罗贯中",10,"四大名著");
        this.bookList[1] = new Book("红楼梦","曹雪芹",10,"四大名著");
        this.bookList[2] = new Book("水浒传","施耐庵",10,"四大名著");
        this.bookList[3] = new Book("西游记","吴承恩",10,"四大名著");
        this.usedSize = 4;
    }

    public Book[] getBookList() {
        return bookList;
    }

    public Book getBook(int pos){
        return bookList[pos];
    }

    public void setBook(int pos, Book book){
        bookList[pos] = book;
    }

    public void setBookList(Book[] bookList) {
        this.bookList = bookList;
    }

    public int getUsedSize() {
        return usedSize;
    }

    public void setUsedSize(int usedSize) {
        this.usedSize = usedSize;
    }
}
